package com.mars.miaosha.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.List;

/**
 *
 * WebMvcConfigurerAdapter.addArgumentResolvers() 方法，可是实现在方法参数上直接使用该类的赋值，
 * 比如HttpRequest等
 * @author MARS
 * @date 2018/5/9
 */

@Configuration
public class WebConfig extends WebMvcConfigurerAdapter{
    @Autowired
    UserArgumentResolver userArgumentResolver;

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(userArgumentResolver);
    }
}
